<template>
    <div class="itemCard">
        <el-image  style="width: 171px; height: 171px" :src="item[defaultProp[0]]"></el-image>
        <div class="info">
            <div>{{item[defaultProp[1]]}}</div>
            <div class="addInfo">编码：{{item[defaultProp[2]]}}</div>
            <div class="addInfo">型号：{{item[defaultProp[3]]}}</div>
            <div class="addInfo" v-if="item.f_unit_price">价值：{{parseFloat(item[defaultProp[4]])}}</div>
            <div class="addInfo" v-if="defaultProp.indexOf('c_stock')>-1">库存：{{item[defaultProp[4]]}}</div>
            <div class="addInfo" v-if="defaultProp.indexOf('recieveNum')>-1">领用数量：{{item.num}}</div>
            <slot/>
        </div>
    </div>
</template>
<script>
export default {
    name:'itemCard',
    props:{
        defaultProp:{ type : Array, default : ()=>{ return ['url','title','no','model'] } },
        item:{ type : Object, default : ()=>{ return {} } },
    },
    methods:{
        
    },
}
</script>

<style lang="stylus" scoped>
.itemCard
    display inline-block
    width: 171px;
    height: 305px;
    background-color: rgba(247, 247, 251, 1);
    border: 1px solid rgba(255, 255, 255, 0);
    margin 0 12px 15px 0
    box-sizing border-box
    .info
        padding 8px 10px 16px 10px
        >div:first-child 
            line-height : 20px;
            color: rgba(16, 16, 16, 1);
            font-size: 14px;
            word-break break-all
            overflow hidden
            padding-bottom 4px
            text-overflow: ellipsis;
        .addInfo
            line-height : 18px;
            color: rgba(149, 149, 149, 1);
            font-size: 12px;
         .btnList
                display flex
                justify-content space-between
                align-items center
                .base
                    width: 99px;
                    line-height : 32px;
                    padding 0
                    border-radius: 4px;
                    font-size: 14px;
                    text-align: center;
                    font-family: Microsoft Yahei;
                .able
                    background-color: rgba(255, 255, 255, 0);
                    color: rgba(10, 142, 255, 1);
                    border: 1px solid rgba(10, 142, 255, 1);
                .disabled
                    background-color: rgba(215, 215, 215, 1);
                    color: rgba(255, 255, 255, 1);
                    border: 1px solid rgba(255, 255, 255, 0);
</style>